<!DOCTYPE html>
<html>

<head>
    <!-- span测试 -->
    <meta charset="utf-8">
    <title>span测试</title>


    <style>
        body{
            padding-top: 100px;
        }

        .box{
            height: 50px;
            width: 100px;
            font-size: 100px;
            color: cadetblue;
            background-color: darkmagenta;
            line-height: 100px;
            overflow: hidden;
            position: relative;
        }

        .box span{
            position: absolute;
        }

        .box:nth-child(1) span{
            top: 0;
        }
        .box:nth-child(2) span{
            bottom: 0;
        }

        .box:nth-child(1){
            animation: up 3s infinite;
        }
        .box:nth-child(2){
            animation: down 3s infinite;
        }

        @keyframes up {
            0%{
                transform: translateY(0);
            }

            50%{
                transform: translateY(-50px);
            }
        }

        @keyframes down {
            0%{
                transform: translateY(0);
            }

            50%{
                transform: translateY(50px);
            }
        }
    </style>

</head>

<body>
    <div class="box">
        <span>高</span>
    </div>
    <div class="box">
        <span>高</span>
    </div>

</body>

</html>